package xlcao.sohutv.util;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.TrafficStats;

public class NetworkHelper {

    private ConnectivityManager cManager;
    private TrafficStats mTS;
    private Context mContext;
    public NetworkHelper(Context context) {
    	mContext = context;
        cManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        mTS = new TrafficStats();
    }

	public void getNetworkSpeed() {
    	AlarmManager am = (AlarmManager) mContext
        .getSystemService(mContext.ALARM_SERVICE);
    	PendingIntent pi = PendingIntent.getActivity(mContext, 0, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT);
    	
    	am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, 1,10000, pi);
    }
}